13. Making vs Using

Making vs using

Dave just talked about some important things having to do with procedures. Let’s review the main points.

By the way, remember that you can also refer to these things as functions.

When we want to do something with a procedure or function, we have to do two things.

First, we have to make the function. In programming terminology, this is called defining the function.

But after we have made/defined the function, it doesn’t do anything—the code just sits there. That is, unless we add instructions to our program to run that function. This is referred to as calling the function. And when we call a function, we can pass it some arguments.

Making vs Using

QUIZ QUESTION::

When you run the following code:

def say_hello(name):
    greeting = "Hello " + name + "!"
    return greeting

print say_hello("Miriam")
print say_hello("Andy")

it displays the result shown below:

Hello Miriam!
Hello Andy!

Do each of the following lines of code have more to do with making/defining the function or using/calling it after it has been made?

ANSWER CHOICES:



Line of code

Making/defining or using/calling?

using/calling

making/defining

using/calling

making/defining